<?php
namespace Admin\Controller;
class MessageController extends CommonController{

	public function send_mail(){
		if(IS_POST){
			$email   = $this->_post('email', '收件人不能为空！');
			$title   = $this->_post('title', '标题不能为空！');
			$content = $this->_post('content', '内容不能为空！');
			$content = htmlspecialchars_decode($content);
			$content = str_replace('/Uploads/', Conf('web_url') . '/Uploads/', $content);
			if(D('Mail')->send($email, $email, $title, $content, true)){
				$this->success('发送成功！');
			}else{
				$this->error(D('Mail')->tips_info);
			}
		}

		$this->display();
	}
}